// Copyright (c) 2010 jon@jondavis.net
// Browser hijacker script for IE6/7/8 to run with the Trixie add-in.
// This script is licensed under the Microsoft Public License (Ms-PL).  
// See http://slcanvas.codeplex.com/license for more details.
//
// ==UserScript==
// @name          SLCanvas Hijacker
// @namespace     http://slcanvas.codeplex.com
// @description	  Runs HTML 5 <canvas> tags in IE using SLCanvas
// @include       *
// ==/UserScript==

//
// Discussion forum: http://slcanvas.codeplex.com/Thread/List.aspx
//

(function() {
    var slcanvasHijacker = {};
    slcanvasHijacker.insertScript = function(src, data) {
        var scriptTag = document.createElement('script');
        scriptTag.setAttribute('type', 'text/javascript');
        scriptTag.setAttribute('language', 'javascript');
        if (src) scriptTag.setAttribute('src', src);
        if (data) scriptTag.appendChild(document.createTextNode(data));
        var headTags = document.getElementsByTagName('head');
        if (headTags.length > 0) {
            headTags.item(0).appendChild(scriptTag);
        }
    };
    window['defaultCanvasRenderMethodToAuto'] = true;
    slcanvasHijacker.insertScript('http://silverlightcanvas.appspot.com/static/slcanvas.js');
})();